﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Funds.aspx.cs" Inherits="_Funds" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Sổ quỹ </title>
    <script src="assets/js/Admin_002.js" type="text/javascript"></script>
    <script src="assets/js/Admin.js" type="text/javascript"></script>
    <script src="assets/js/Validation.js" type="text/javascript"></script>
    <%--<script src="assets/js/jquery-1.4.2.js" type="text/javascript"></script>--%>
    <script src="assets/jquery/1.7.1/jquery-1.7.1.min.js" type="text/javascript"></script>
    <script src="assets/jquery/1.7.1/jquery.ui.core.min.js" type="text/javascript"></script>
    <script src="assets/jquery/1.7.1/jquery.ui.widget.min.js" type="text/javascript"></script>
    <script src="assets/jquery/1.7.1/jquery.ui.position.min.js" type="text/javascript"></script>
    <script src="assets/jquery/1.7.1/jquery.ui.autocomplete.min.js" type="text/javascript"></script>
    <link rel="stylesheet" href="assets/jquery/1.7.1/jquery-ui-1.8.16.custom.css" />
    <script src="assets/jquery/jquery-ui.min.js" type="text/javascript"></script>
    <script src="assets/jquery/jquery.dialog.extra.js" type="text/javascript"></script>
    <script src="Assets/Js/eventnotification.js" type="text/javascript"></script>
    <script src="assets/js/jquery.validate.js" type="text/javascript"></script>
    <script type='text/javascript' src="assets/js/common.js"></script>
    <%--<script type='text/javascript' src="assets/js/jquery.autocomplete.js"></script>--%>
    <link href="assets/jquery/jquery-ui.css" rel="stylesheet" type="text/css" />
    <link rel="stylesheet" type="text/css" href="assets/css/jquery.autocomplete.css" />
    <link rel="stylesheet" href="assets/css/reset.css" type="text/css" />
    <link rel="stylesheet" href="assets/css/styleexpress.css" type="text/css" />
    <link rel="stylesheet" href="assets/css/invalid.css" type="text/css" media="screen" />
    <link rel="stylesheet" href="Assets/css/EditTableCell.css" type="text/css" />
    <script type='text/javascript' src="Assets/js/jquery-custom-1.0.0.js?v=2011"></script>
    <script type='text/javascript' src="assets/js/Funds.js"></script>
    <link rel="stylesheet" type="text/css" href="assets/css/datepicker.css" />
    <script type='text/javascript' src="assets/js/jquery.ui.datepicker.js"></script>
    <link rel="stylesheet" type="text/css" href="assets/css/jquery.autocomplete.css" />
    <script type="text/javascript">
        $(document).ready(function () {
            $("#txtFrom").datepicker({ dateFormat: "dd-mm-yy" });
            $("#txtCreateDate").datepicker({ dateFormat: "dd-mm-yy" });
            $("#txtTo").datepicker({ dateFormat: "dd-mm-yy" });
            $("#btnExport").click(function () {
                openwindow();
            });
        });
        function openwindow() {
            window.open("./Funds.Export.aspx?action=export", "mywindow", "menubar=0,status=0,directories=0,resizable=1,scrollbars=1,width=720,height=500");
        }
    </script>
    <style type="text/css">
        .thheader
        {
            font-weight: bold;
            vertical-align: middle;
            text-align: center;
            font-size: 11px;
            border: 1px solid #ccc !important;
            line-height: 7px !important; ;}
        .totalamount
        {
            font-weight: bold;
        }
    </style>
    <script type="text/javascript">
        function getUrlVars() {
            var vars = {};
            var parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function (m, key, value) {
                vars[key] = value;
            });
            return vars;
        }
        function doDelete(strID, strName) {
            if (confirm('Bạn có thực sự muốn xóa ' + strName + '?')) {
                var vnpage = getUrlVars()['page_number'];
                var vChar = getUrlVars()['letter'];
                var strHref = "";
                if (vnpage)
                    strHref = "Funds.aspx?action=delete&ID=" + strID + "&page_number=" + vnpage;
                else
                    strHref = "Funds.aspx?action=delete&ID=" + strID;

                if (vChar)
                    window.location.href = strHref + "&letter=" + vChar;
                else
                    window.location.href = strHref;
            }
        }
        $(window).load(function () {
            //$("#ddSubjectCarr").hide();
            //$("#ddSubjectCustomer").show();
            //$("#txtPaymentSubject").hide();
            //Get list customer
            jQuery.ajax({
                type: "POST",
                url: "Handlers/Event.ashx?action=listcustomer",
                success: function (msg) {
                    availableTags = eval('(' + msg + ')');
                    paymentSubjectSuggestion(availableTags);
                }
            });
        });


        jQuery("document").ready(function () {
            jQuery("#txtFileNumber").blur(function () {
                jQuery.ajax({
                    type: "POST",
                    url: "AjaxFile/GetCostNo.ashx",
                    success: function (msg) {
                        var arrSource = msg.split(",");
                        $('#txtFileNumber').autocomplete(
                        { source: arrSource }
                        );
                    }
                });
            }).blur();

            $("#ddSubjectType").change(function () {
                clearSubjectValue();
                if ($(this).val() == "1" || $(this).val() == "5") {
                    //$("#ddSubjectCarr").hide();
                    //$("#ddSubjectCustomer").show();
                    //$("#txtPaymentSubject").hide();
                    //Get list customer
                    jQuery.ajax({
                        type: "POST",
                        url: "Handlers/Event.ashx?action=listcustomer",
                        success: function (msg) {
                            availableTags = eval('(' + msg + ')');
                            paymentSubjectSuggestion(availableTags);
                        }
                    });
                }
                else if ($(this).val() == "3" || $(this).val() == "4") {
                    //$("#ddSubjectCarr").show();
                    //$("#ddSubjectCustomer").hide();
                    //$("#txtPaymentSubject").hide();
                    //Get list carrier
                    jQuery.ajax({
                        type: "POST",
                        url: "Handlers/Event.ashx?action=listCarrier",
                        success: function (msg) {
                            availableTags = eval('(' + msg + ')');
                            paymentSubjectSuggestion(availableTags);
                        }
                    });
                }
                //                else if ($(this).val() == "2" || $(this).val() == "6") {
                //                    $("#ddSubjectCarr").hide();
                //                    $("#ddSubjectCustomer").hide();
                //                    $("#txtPaymentSubject").show();
                //                }

            });
        });
        var arrSubjectTypeName = [
                 "THU KH", "THU KHÁC", "TTNCC", "TTCOM NCC", "TTCOM KH", "TT KHÁC"
                ];
        function paymentSubjectSuggestion(availableTags) {
            $('#txtPaymentSubject').autocomplete({
                source: availableTags,
                focus: function (event, ui) {
                    $(this).val(ui.item.label);
                    return false;
                },
                select: function (event, ui) {
                    $('#txtPaymentSubjectID').val(ui.item.value);
                    $(this).val(ui.item.label);
                    return false;
                }
            })
        }
        function clearSubjectValue() {
            $('#txtPaymentSubjectID').val("");
            $('#txtPaymentSubject').val("");
        }
    </script>
</head>
<body>
    <div id="body-wrapper">
        <div id="header">
            <!--#include virtual="include/top.ascx"-->
        </div>
        <div id="main-content1">
            <h2>
                SỔ QUỸ
                <%=Province %>
            </h2>
            <div class="clear">
            </div>
            <div>
                <asp:Label ID="lblError" CssClass="error" Text="" runat="server"></asp:Label></div>
            <div class="content-box">
                <form id="frmEdit" runat="server" defaultbutton="btnSearch">
                <%if (nPermissions >= 3)
                  {%>
                <asp:Panel ID="Panel1" runat="server" DefaultButton="btnSave">
                    <div id="addnewbox" style="display: none;">
                        <table class="adminedit" style="width: 100%;">
                            <tr style="background: #ECECEC;">
                                <th align="center" rowspan="3" class="thheader">
                                    Ngày tháng
                                </th>
                                <th align="center" rowspan="3" class="thheader">
                                    Số File
                                </th>
                                <th align="center" rowspan="3" class="thheader">
                                    Loại hình TT
                                </th>
                                <th align="center" rowspan="3" class="thheader">
                                    Đối tượng
                                </th>
                                <th align="center" rowspan="3" class="thheader">
                                    Diễn giải
                                </th>
                                <th align="center" rowspan="3" class="thheader">
                                    Bank
                                </th>
                                <th align="center" rowspan="2" colspan="2" class="thheader">
                                    TKĐƯ
                                </th>
                                <th align="center" colspan="4" class="thheader">
                                    Tiền mặt
                                </th>
                                <th align="center" colspan="4" class="thheader">
                                    Tiền ngân hàng
                                </th>
                            </tr>
                            <tr style="background: #ECECEC; font-weight: bold; vertical-align: middle; text-align: center;">
                                <th align="center" colspan="2" class="thheader">
                                    VND
                                </th>
                                <th align="center" colspan="2" class="thheader">
                                    USD
                                </th>
                                <th align="center" colspan="2" class="thheader">
                                    VND
                                </th>
                                <th align="center" colspan="2" class="thheader">
                                    USD
                                </th>
                            </tr>
                            <tr style="background: #ECECEC; font-weight: bold; vertical-align: middle; text-align: center;">
                                <th align="center" class="thheader">
                                    Nợ
                                </th>
                                <th align="center" class="thheader">
                                    Có
                                </th>
                                <th align="center" class="thheader">
                                    Thu
                                </th>
                                <th align="center" class="thheader">
                                    Chi
                                </th>
                                <th align="center" class="thheader">
                                    Thu
                                </th>
                                <th align="center" class="thheader">
                                    Chi
                                </th>
                                <th align="center" class="thheader">
                                    Thu
                                </th>
                                <th align="center" class="thheader">
                                    Chi
                                </th>
                                <th align="center" class="thheader">
                                    Thu
                                </th>
                                <th align="center" class="thheader">
                                    Chi
                                </th>
                            </tr>
                            <tr>
                                <td>
                                    <asp:TextBox class="cls" ID="txtCreateDate" CssClass="calendar-icon" runat="server"
                                        Width="100px" TabIndex="2"></asp:TextBox>
                                </td>
                                <td>
                                    <asp:TextBox class="cls" ID="txtFileNumber" runat="server" Width="70px" TabIndex="2"></asp:TextBox>
                                </td>
                                <td>
                                    <asp:DropDownList ID="ddSubjectType" runat="server" AutoPostBack="false">
                                        <asp:ListItem Text="THU KH" Value="1"></asp:ListItem>
                                        <asp:ListItem Text="THU KH&#193;C" Value="2"></asp:ListItem>
                                        <asp:ListItem Text="TTNCC" Value="3"></asp:ListItem>
                                        <asp:ListItem Text="TTCOM NCC" Value="4"></asp:ListItem>
                                        <asp:ListItem Text="TTCOM KH" Value="5"></asp:ListItem>
                                        <asp:ListItem Text="TT KH&#193;C" Value="6"></asp:ListItem>
                                    </asp:DropDownList>
                                </td>
                                <td>
                                    <%--<asp:DropDownList ID="ddSubjectCarr" runat="server" Width="100px">
                                </asp:DropDownList>
                                <asp:DropDownList ID="ddSubjectCustomer" runat="server" Width="100px">
                                </asp:DropDownList>--%>
                                    <asp:TextBox class="cls" ID="txtPaymentSubject" runat="server" Width="100px" TabIndex="2"></asp:TextBox>
                                    <asp:HiddenField ID="txtPaymentSubjectID" runat="server"></asp:HiddenField>
                                </td>
                                <td>
                                    <asp:TextBox class="cls" ID="txtDescription" runat="server" Width="100px" TabIndex="2"></asp:TextBox>
                                </td>
                                <td>
                                    <asp:DropDownList ID="ddBankName" runat="server">
                                        <asp:ListItem Text="TM" Value="TM"></asp:ListItem>
                                        <asp:ListItem Text="VCB" Value="VCB"></asp:ListItem>
                                        <asp:ListItem Text="BIDV" Value="BIDV"></asp:ListItem>
                                        <asp:ListItem Text="TCB" Value="TCB"></asp:ListItem>
                                    </asp:DropDownList>
                                </td>
                                <td>
                                    <asp:TextBox class="cls" ID="txtReciprocalAccount_Had" runat="server" Width="50px"
                                        TabIndex="2"></asp:TextBox>
                                </td>
                                <td>
                                    <asp:TextBox class="cls" ID="txtReciprocalAccount_Debt" runat="server" Width="50px"
                                        TabIndex="2"></asp:TextBox>
                                </td>
                                <td>
                                    <asp:TextBox class="cls" ID="txtCashVND_Thu" runat="server" Width="50px" TabIndex="2"></asp:TextBox>
                                </td>
                                <td>
                                    <asp:TextBox class="cls" ID="txtCashVND_Chi" runat="server" Width="50px" TabIndex="2"></asp:TextBox>
                                </td>
                                <td>
                                    <asp:TextBox class="cls" ID="txtCashUSD_Thu" runat="server" Width="50px" TabIndex="2"></asp:TextBox>
                                </td>
                                <td>
                                    <asp:TextBox class="cls" ID="txtCashUSD_Chi" runat="server" Width="50px" TabIndex="2"></asp:TextBox>
                                </td>
                                <td>
                                    <asp:TextBox class="cls" ID="txtBankVND_Thu" runat="server" Width="50px" TabIndex="2"></asp:TextBox>
                                </td>
                                <td>
                                    <asp:TextBox class="cls" ID="txtBankVND_Chi" runat="server" Width="50px" TabIndex="2"></asp:TextBox>
                                </td>
                                <td>
                                    <asp:TextBox class="cls" ID="txtBankUSD_Thu" runat="server" Width="50px" TabIndex="2"></asp:TextBox>
                                </td>
                                <td>
                                    <asp:TextBox class="cls" ID="txtBankUSD_Chi" runat="server" Width="50px" TabIndex="2"></asp:TextBox>
                                </td>
                            </tr>
                        </table>
                        <table class="paramlist admintable" width="100%">
                            <tr>
                                <td>
                                    <asp:Button class="button" ID="btnSave" runat="server" TabIndex="19" Text="Save"
                                        OnClick="btnSave_Click" />
                                </td>
                            </tr>
                        </table>
                </asp:Panel>
            </div>
            <%} %>
            <div class="content-box-header">
                <%if (nPermissions >= 9)
                  { %>
                <asp:DropDownList CssClass="ItemSearch" ID="ddProvince" runat="server" AutoPostBack="true"
                    OnSelectedIndexChanged="ddProvince_SelectedIndexChanged">
                </asp:DropDownList>
                <%} %>
                <asp:DropDownList CssClass="ItemSearch" ID="ddFundsBank" runat="server" AutoPostBack="true"
                    OnSelectedIndexChanged="ddFundsBank_SelectedIndexChanged">
                    <asp:ListItem Text="Select Bank" Value=""></asp:ListItem>
                    <asp:ListItem Text="TM" Value="TM"></asp:ListItem>
                    <asp:ListItem Text="VCB" Value="VCB"></asp:ListItem>
                    <asp:ListItem Text="BIDV" Value="BIDV"></asp:ListItem>
                    <asp:ListItem Text="TCB" Value="TCB"></asp:ListItem>
                    <asp:ListItem Text="Non Banks" Value="NonBanks"></asp:ListItem>
                </asp:DropDownList>
                <asp:DropDownList CssClass="ItemSearch" ID="ddFundsPayment" runat="server" AutoPostBack="true"
                    OnSelectedIndexChanged="ddFundsPayment_SelectedIndexChanged">
                    <asp:ListItem Text="Select HTTT" Value="0"></asp:ListItem>
                    <asp:ListItem Text="THU KH" Value="1"></asp:ListItem>
                    <asp:ListItem Text="THU KHÁC" Value="2"></asp:ListItem>
                    <asp:ListItem Text="TTNCC" Value="3"></asp:ListItem>
                    <asp:ListItem Text="TTCOM NCC" Value="4"></asp:ListItem>
                    <asp:ListItem Text="TTCOM KH" Value="5"></asp:ListItem>
                    <asp:ListItem Text="TT KHÁC" Value="6"></asp:ListItem>
                </asp:DropDownList>
                <asp:DropDownList CssClass="ItemSearch" ID="ddCurr" runat="server" AutoPostBack="true"
                    OnSelectedIndexChanged="ddCurr_SelectedIndexChanged">
                    <asp:ListItem Text="CURR" Value="-1"></asp:ListItem>
                    <asp:ListItem Text="VND" Value="0"></asp:ListItem>
                    <asp:ListItem Text="USD" Value="1"></asp:ListItem>
                </asp:DropDownList>
                Find:
                <asp:TextBox CssClass="ItemSearch" ID="keyword" Text="" runat="server"></asp:TextBox>
                By:
                <asp:DropDownList CssClass="ItemSearch" ID="ddType" runat="server">
                    <asp:ListItem Text="" Value="0"></asp:ListItem>
                    <asp:ListItem Text="Số file" Value="1"></asp:ListItem>
                    <asp:ListItem Text="Đối tượng" Value="2"></asp:ListItem>
                    <asp:ListItem Text="TKĐƯ Nợ" Value="3"></asp:ListItem>
                    <asp:ListItem Text="TKĐƯ Có" Value="4"></asp:ListItem>
                </asp:DropDownList>
                <asp:TextBox ID="txtFrom" CssClass="calendar-icon ItemSearch" runat="server" value="From"
                    onclick="if(this.value=='From'){this.value=''; this.style.color='#000'}" onblur="if(this.value==''){this.value='From'; this.style.color='#555'}"
                    Width="125px"></asp:TextBox>
                <asp:TextBox ID="txtTo" CssClass="calendar-icon ItemSearch" runat="server" value="To"
                    Width="125px" onclick="if(this.value=='To'){this.value=''; this.style.color='#000'}"
                    onblur="if(this.value==''){this.value='To'; this.style.color='#555'}"></asp:TextBox>
                &nbsp;<asp:Button ID="btnSearch" runat="server" Text="&nbsp;Seach&nbsp;" CssClass="button"
                    OnClick="btnSearch_Click" />
                <input id="btnAddNew" type="button" style="float: right; margin: 5px 10px;" class="button"
                    value="Add new" />
                <%if (nPermissions > 7)
                  { %>
                <input id="btnExport" type="button" style="float: right; margin: 5px 10px;" class="button"
                    value="&nbsp;Export&nbsp;" />
                <asp:Button ID="btnCloseFile" Style="float: right; margin: 5px 10px;" CssClass="button"
                    runat="server" Text="&nbsp;Close&nbsp;" OnClick="btnCloseFile_Click" />
                <%} %>
                <div class="clear">
                </div>
            </div>
            <asp:Repeater ID="rptData" runat="server">
                <ItemTemplate>
                    <tr onmouseover="this.style.background='#dbf0c9'" onmouseout="this.style.background='#ffffff'"
                        fundsid='<%#Eval("ID") %>'>
                        <td>
                            <%# DataBinder.Eval(Container.DataItem, "Index")%>
                        </td>
                        <td editable="true" code="CreateDate">
                            <%# DataBinder.Eval(Container.DataItem, "CreateDate")%>
                        </td>
                        <td editable="true" code="FileNumber" completesource="vFileNumber" class="wrapword">
                            <%# DataBinder.Eval(Container.DataItem, "FileNumber")%>
                        </td>
                        <td editable="true" code="SubjectTypeName" completesource="arrSubjectTypeName">
                            <%# DataBinder.Eval(Container.DataItem, "SubjectTypeName")%>
                        </td>
                        <td editable="true" code="PaymentSubject">
                            <%# DataBinder.Eval(Container.DataItem, "PaymentSubject")%>
                        </td>
                        <td editable="true" code="Description">
                            <%# DataBinder.Eval(Container.DataItem, "Description")%>
                        </td>
                        <td editable="true" code="BankName">
                            <%# DataBinder.Eval(Container.DataItem, "BankName")%>
                        </td>
                        <td editable="true" code="ReciprocalAccount_Had">
                            <%# DataBinder.Eval(Container.DataItem, "ReciprocalAccount_Had")%>
                        </td>
                        <td editable="true" code="ReciprocalAccount_Debt">
                            <%# DataBinder.Eval(Container.DataItem, "ReciprocalAccount_Debt")%>
                        </td>
                        <td editable="true" code="CashVND_Thu">
                            <%# DataBinder.Eval(Container.DataItem, "CashVND_Thu")%>
                        </td>
                        <td editable="true" code="CashVND_Chi">
                            <%# DataBinder.Eval(Container.DataItem, "CashVND_Chi")%>
                        </td>
                        <td editable="true" code="CashUSD_Thu">
                            <%# DataBinder.Eval(Container.DataItem, "CashUSD_Thu")%>
                        </td>
                        <td editable="true" code="CashUSD_Chi">
                            <%# DataBinder.Eval(Container.DataItem, "CashUSD_Chi")%>
                        </td>
                        <td editable="true" code="BankVND_Thu">
                            <%# DataBinder.Eval(Container.DataItem, "BankVND_Thu")%>
                        </td>
                        <td editable="true" code="BankVND_Chi">
                            <%# DataBinder.Eval(Container.DataItem, "BankVND_Chi")%>
                        </td>
                        <td editable="true" code="BankUSD_Thu">
                            <%# DataBinder.Eval(Container.DataItem, "BankUSD_Thu")%>
                        </td>
                        <td editable="true" code="BankUSD_Chi">
                            <%# DataBinder.Eval(Container.DataItem, "BankUSD_Chi")%>
                        </td>
                        <td>
                            <%# DataBinder.Eval(Container.DataItem, "Action")%>
                        </td>
                    </tr>
                </ItemTemplate>
                <HeaderTemplate>
                    <table cellspacing="0" cellpadding="0" width="100%" border="0" class="adminlist"
                        editcellcontent="true">
                        <thead>
                            <tr>
                                <th align="center" rowspan="3" width="30px">
                                    Index
                                </th>
                                <th align="center" rowspan="3" width="60px">
                                    Ngày tháng
                                </th>
                                <th align="center" rowspan="3" width="70px">
                                    Số File
                                </th>
                                <th align="center" rowspan="3" width="70px">
                                    Loại hình TT
                                </th>
                                <th align="center" rowspan="3" width="100px">
                                    Đối tượng
                                </th>
                                <th align="center" rowspan="3" width="100px">
                                    Diễn giải
                                </th>
                                <th align="center" rowspan="3" width="30px">
                                    Bank
                                </th>
                                <th align="center" rowspan="2" colspan="2">
                                    TKĐƯ
                                </th>
                                <th align="center" colspan="4">
                                    Tiền mặt
                                </th>
                                <th align="center" colspan="4">
                                    Tiền ngân hàng
                                </th>
                                <th align="center" rowspan="3" class="thheader" width="70px">
                                    Action
                                </th>
                            </tr>
                            <tr>
                                <th align="center" colspan="2">
                                    VND
                                </th>
                                <th align="center" colspan="2">
                                    USD
                                </th>
                                <th align="center" colspan="2">
                                    VND
                                </th>
                                <th align="center" colspan="2">
                                    USD
                                </th>
                            </tr>
                            <tr>
                                <th align="center" width="30px">
                                    Nợ
                                </th>
                                <th align="center" width="30px">
                                    Có
                                </th>
                                <th align="center" width="50px">
                                    Thu
                                </th>
                                <th align="center" width="50px">
                                    Chi
                                </th>
                                <th align="center" width="50px">
                                    Thu
                                </th>
                                <th align="center" width="50px">
                                    Chi
                                </th>
                                <th align="center" width="50px">
                                    Thu
                                </th>
                                <th align="center" width="50px">
                                    Chi
                                </th>
                                <th align="center" width="50px">
                                    Thu
                                </th>
                                <th align="center" width="50px">
                                    Chi
                                </th>
                            </tr>
                        </thead>
                </HeaderTemplate>
                <FooterTemplate>
                    <tr>
                        <td colspan="9" style="text-align: right; padding-right: 20px !important; font-weight: 600 !important;">
                            Tổng phát sinh
                        </td>
                        <td class="totalamount">
                            <%= CashVND_Thu%>
                        </td>
                        <td class="totalamount">
                            <% =CashVND_Chi%>
                        </td>
                        <td class="totalamount">
                            <% =CashUSD_Thu%>
                        </td>
                        <td class="totalamount">
                            <% =CashUSD_Chi%>
                        </td>
                        <td class="totalamount">
                            <% =BankVND_Thu%>
                        </td>
                        <td class="totalamount">
                            <% =BankVND_Chi%>
                        </td>
                        <td class="totalamount">
                            <% =BankUSD_Thu%>
                        </td>
                        <td class="totalamount">
                            <% =BankUSD_Chi%>
                        </td>
                        <td>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="9" style="text-align: right; padding-right: 20px !important; font-weight: 600 !important;">
                            Số dư cuối kỳ
                        </td>
                        <td colspan="2" class="totalamount">
                            <%= CashVnD_Balance%>
                        </td>
                        <td colspan="2" class="totalamount">
                            <%= CashUSD_Balance%>
                        </td>
                        <td colspan="2" class="totalamount">
                            <%= BankVnD_Balance%>
                        </td>
                        <td colspan="2" class="totalamount">
                            <%= BankUSD_Balance%>
                        </td>
                        <td>
                        </td>
                    </tr>
                    </TABLE>
                </FooterTemplate>
            </asp:Repeater>
            <div class="clear">
            </div>
            <table cellspacing="0" cellpadding="0" width="100%" border="0">
                <tr>
                    <td style="vertical-align: top;">
                        <%if (nPermissions >= 9)
                          { %>
                        <div class="content-box-header" style="width: 100%; margin-top: 20px;">
                            <h3 style="cursor: s-resize;">
                                TỔNG CỘNG CÁC QUỸ
                            </h3>
                            <div style="float: right; margin-top: 10px; font-weight: bold;">
                                Tỷ gia:
                                <asp:TextBox ID="txtTygia" runat="server" OnTextChanged="txtTygia_TextChanged" AutoPostBack="True"></asp:TextBox></div>
                            <div class="clear">
                            </div>
                        </div>
                        <asp:Repeater ID="rptAllFunds" runat="server">
                            <ItemTemplate>
                                <tr onmouseover="this.style.background='#dbf0c9'" onmouseout="this.style.background='#ffffff'">
                                    <td>
                                        <%# DataBinder.Eval(Container.DataItem, "Index")%>
                                    </td>
                                    <td>
                                        <%# DataBinder.Eval(Container.DataItem, "Province")%>
                                    </td>
                                    <td>
                                        <%# DataBinder.Eval(Container.DataItem, "VNDBalance")%>
                                    </td>
                                    <td>
                                        <%# DataBinder.Eval(Container.DataItem, "USDBalance")%>
                                    </td>
                                    <td>
                                        <%# DataBinder.Eval(Container.DataItem, "TotalBalance")%>
                                    </td>
                                </tr>
                            </ItemTemplate>
                            <HeaderTemplate>
                                <table cellspacing="0" cellpadding="0" border="0" class="adminlist" style="width: 100%;"
                                    editcellcontent="true">
                                    <thead>
                                        <tr>
                                            <th>
                                                Index
                                            </th>
                                            <th align="center" width="200px">
                                                Cộng toàn bộ các quỹ
                                            </th>
                                            <th align="center" width="150px">
                                                VND
                                            </th>
                                            <th align="center" width="150px">
                                                USD
                                            </th>
                                            <th align="center" width="150px">
                                                Tổng tiền
                                            </th>
                                        </tr>
                                    </thead>
                            </HeaderTemplate>
                            <FooterTemplate>
                                <tr>
                                    <td colspan="2" style="text-align: right; padding-right: 30px !important; font-weight: bold;">
                                        Tổng cộng các quỹ
                                    </td>
                                    <td class="totalamount">
                                        <%=TotalAllVND %>
                                    </td>
                                    <td class="totalamount">
                                        <%=TotalAllUSD %>
                                    </td>
                                    <td class="totalamount">
                                        <%=TotalAllBalance %>
                                    </td>
                                </tr>
                                </TABLE>
                            </FooterTemplate>
                        </asp:Repeater>
                        <%} %>
                    </td>
                    <td style="vertical-align: top;">
                        <div class="content-box-header" style="width: 100%; margin-top: 20px;">
                            <h3 style="cursor: s-resize;">
                                TỔNG CỘNG THEO NGÂN HÀNG</h3>
                            <div class="clear">
                            </div>
                        </div>
                        <asp:Repeater ID="RpBalance" runat="server">
                            <ItemTemplate>
                                <tr onmouseover="this.style.background='#dbf0c9'" onmouseout="this.style.background='#ffffff'">
                                    <td>
                                        <%# DataBinder.Eval(Container.DataItem, "Index")%>
                                    </td>
                                    <td>
                                        <%# DataBinder.Eval(Container.DataItem, "BankName")%>
                                    </td>
                                    <td>
                                        <%# DataBinder.Eval(Container.DataItem, "VNDBalance")%>
                                    </td>
                                    <td>
                                        <%# DataBinder.Eval(Container.DataItem, "USDBalance")%>
                                    </td>
                                </tr>
                            </ItemTemplate>
                            <HeaderTemplate>
                                <table cellspacing="0" cellpadding="0" border="0" class="adminlist" style="width: 100%;"
                                    editcellcontent="true">
                                    <thead>
                                        <tr>
                                            <th>
                                                Index
                                            </th>
                                            <th align="center" width="350px">
                                                Tổng cộng theo ngân hàng
                                            </th>
                                            <th align="center" width="150px">
                                                VND
                                            </th>
                                            <th align="center" width="150px">
                                                USD
                                            </th>
                                        </tr>
                                    </thead>
                            </HeaderTemplate>
                            <FooterTemplate>
                                </TABLE>
                            </FooterTemplate>
                        </asp:Repeater>
                    </td>
                </tr>
                <%--Fund Future--%>
                <tr>
                    <td style="vertical-align: top;">
                        <%if (nPermissions >= 9)
                          { %>
                        <asp:Repeater ID="rpFundsFuture" runat="server">
                            <ItemTemplate>
                                <tr onmouseover="this.style.background='#dbf0c9'" onmouseout="this.style.background='#ffffff'">
                                    <td>
                                        <%# DataBinder.Eval(Container.DataItem, "Province")%>
                                    </td>
                                    <td>
                                        <%# DataBinder.Eval(Container.DataItem, "Total_Must_Obtained_Customer")%>
                                    </td>
                                    <td>
                                        <%# DataBinder.Eval(Container.DataItem, "Total_Must_Payment_Agent")%>
                                    </td>
                                    <td>
                                        <%# DataBinder.Eval(Container.DataItem, "Total_Must_Borrow")%>
                                    </td>
                                    <td>
                                        <%# DataBinder.Eval(Container.DataItem, "Total_Fund_Future")%>
                                    </td>
                                </tr>
                            </ItemTemplate>
                            <HeaderTemplate>
                                <table cellspacing="0" cellpadding="0" border="0" class="adminlist" style="width: 100%;"
                                    editcellcontent="true">
                                    <thead>
                                        <tr>
                                            <th align="center" width="200px">
                                                Chi tiết
                                            </th>
                                            <th align="center" width="150px">
                                                Phải thu KH
                                            </th>
                                            <th align="center" width="150px">
                                                Phải trả NCC
                                            </th>
                                            <th align="center" width="150px">
                                                Tiền vay
                                            </th>
                                            <th align="center" width="150px">
                                                Tiền tương lai
                                            </th>
                                        </tr>
                                    </thead>
                            </HeaderTemplate>
                            <FooterTemplate>
                                <tr>
                                    <td style="text-align: right; padding-right: 30px !important; font-weight: bold;">
                                        Tổng cộng các quỹ
                                    </td>
                                    <td class="totalamount">
                                        <%=Sum_Total_Must_Obtained_Customer.ToString("#,#") %>
                                    </td>
                                    <td class="totalamount">
                                        <%=Sum_Total_Must_Payment_Agent.ToString("#,#")%>
                                    </td>
                                    <td class="totalamount">
                                        <%=Sum_Total_Must_Borrow.ToString("#,#")%>
                                    </td>
                                    <td class="totalamount">
                                        <%=Sum_Total_Fund_Future.ToString("#,#")%>
                                    </td>
                                </tr>
                                </TABLE>
                            </FooterTemplate>
                        </asp:Repeater>
                        <%} %>
                    </td>
                    <td style="vertical-align: top;">
                    </td>
                </tr>
            </table>
            <div class="clear">
            </div>
            <div id="footer">
                <%=strPager%>
            </div>
            </form>
        </div>
    </div>
    </div>
</body>
</html>
